SMOODEV-1527: eso-refresher keep-alive — don't unref the interval (land stranded fix)#125
Merged
Merged
Conversation
The refresher exited 0 right after its initial mint+write — it unref'd the
interval timer, and the 'await new Promise(() => {})' keep-alive in main() does
NOT hold Node's event loop open on its own. Result: the sidecar CrashLoopBackOff'd
(re-minting on each restart, which masked it, but it's not a stable daemon).
Don't unref the production interval — it's what keeps the loop alive. Tests
inject their own scheduler, so they're unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4
🦋 Changeset detectedLatest commit: 33663ae The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The eso-refresher daemon exits 0 right after its initial mint+write: it
unref()s its interval timer, and theawait new Promise(() => {})keep-alive inmain()does NOT hold Node's event loop open by itself — no ref'd handles means the process exits → CrashLoopBackOff in the sidecar.This fix was written 5 weeks ago (branch
SMOODEV-1527-refresher-keepalive, 2026-06-02) and never landed — surfaced by the config-worktree hygiene sweep. Main's comment at the keep-alive site even asserts the wrong mental model ("hold the loop open explicitly"); a pending promise holds nothing.Solution
Cherry-pick of the stranded commit: stop
unref()ing the production interval (it is precisely what keeps the daemon alive; tests inject their own scheduler so they're unaffected;stop()stillclearIntervals for clean shutdown) + fix the stale comment at themain()hold point.Verification
pnpm vitest run src/eso-refresher— 6/6 green.🤖 Generated with Claude Code
https://claude.ai/code/session_01LE7V35vzRiHyxBFE8wAxb4